<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
  <div class="page">
    <% include components/top.inc.ejs %>
    <div style="float: left; width: 50%;">
      <form action="?" method="post">
          <p>姓名：<input type="text" name="name" /></p>
          <p>邮件：<input type="text" name="email" /></p>
          <p>电话：<input type="text" name="phone" /></p>
          <p>主题：<textarea name="subject"></textarea></p>
          <p><input type="submit" value="添加" /></p>
      </form>
    </div>
    <table border="1" width="90%">        
      <tbody>
        <tr>
          <th>ID</th>
          <th>姓名</th>
          <th>邮件</th>
          <th>电话</th>
          <th>主题</th>
        </tr>
      </tbody>
      <tbody>
        <% for (var i=0; i<msglist.length; i++) { %>
        <tr>
          <td><%= msglist[i].id %></td>
          <td><%= msglist[i].name %></td>
          <td><%= msglist[i].email %></td>
          <td><%= msglist[i].phone %></td>
          <td><%= msglist[i].subject %></td>
        </tr>
        <% } %>          
      </tbody>
    </table>
  </div>
</body>
</html>